<template>
    <el-dialog title="订单详情" width="760px" :visible.sync="dialog">
        <el-form ref="order_message" :model="order_message" label-width="120px">
            <el-form-item label="编号">{{order_message.trade_no}}</el-form-item>
            <el-form-item label="微信名称">{{order_message.nickname}}</el-form-item>
            <el-form-item label="性别">{{order_message.sex_str}}</el-form-item>
            <el-form-item label="头像"><img :src="order_message.headimgurl" alt=""/></el-form-item>
            <el-form-item label="openid">{{order_message.openid}}</el-form-item>
            <el-form-item label="手机号">{{order_message.phone}}</el-form-item>
<!--            <el-form-item label="关注公众号时间">{{order_message.subscribe_time}}</el-form-item>-->

            <el-form-item label="订单名称">{{order_message.title}}</el-form-item>
            <el-form-item label="订单标题" v-if="order_message.subtitle">{{order_message.subtitle}}</el-form-item>
            <el-form-item label="达人等级" v-if="order_message.channel_name">{{order_message.channel_name}}</el-form-item>
            <el-form-item label="购买数量" v-if="order_message.num">{{order_message.num}}</el-form-item>
            <el-form-item label="支付时间">{{order_message.success_at}}</el-form-item>
            <el-form-item label="支付金额">{{order_message.total_fee}}</el-form-item>
            <el-form-item label="有效起期" v-if="order_message.start_date">{{order_message.start_date}}</el-form-item>
            <el-form-item label="有效止期" v-if="order_message.end_date">{{order_message.end_date}}</el-form-item>
        </el-form>
    </el-dialog>
</template>

<script>
    export default {
        name: "OrderDetailDialog",
        data(){
            return {
                dialog:false,
                order_id:0,
                order_message:{},
            }
        },
        methods:{
            init(order_id){
                this.dialog = true;
                this.order_id = order_id;
                this.post('/api/laifei/orders/detail',{order_id:order_id}).then(result=>{
                    if(result.code === 0){
                        this.order_message = result.data;
                    }
                })
            }
        }
    }
</script>

<style scoped>

</style>
